import Request from '@/utils/requset.js'
let request = new Request().http

function removeStr(obj) {
  if(obj) {
    let removePropertyOfNull=function(obj){
      Object.keys(obj).forEach(item=>{
        if(!obj[item])  delete obj[item]
      })
      return obj;
    }
    removePropertyOfNull(obj)
  }
  return obj?obj:''
}

// 查询我的订单列表(打印甲订单)穿戴甲
const getGoodsOrderList = (params) => {
	return request({
	    url: "/nailGoodsOrder/queryMyOrderList",
	    method: "GET",
	    params: removeStr(params),
	})
}

// 通过id查询我的订单详情(彩绘甲)
const getGoodsOrderInfo = (params) => {
	return request({
	    url: "/nailGoodsOrder/queryById",
	    method: "GET",
	    params: removeStr(params),
	})
}

// 取消打印甲订单(彩绘甲)
const getPrintCancelOrder = (params) => {
	return request({
	    url: "/nailPrintOrder/cancelOrder",
	    method: "GET",
	    params: removeStr(params),
	})
}

// 订单列表（底部导航）分享调接口 orderId
const getSharePrintOrder = (params) => {
	return request({
	    url: "/nailPrintOrder/sharePrintOrder",
	    method: "GET",
	    params: removeStr(params),
	})
}

// 订单列表（底部导航）
const getPrintOrder = (params) => {
	return request({
	    url: "/nailPrintOrder/printOrder",
	    method: "GET",
	    params: removeStr(params),
	})
}

// 我的订单（我的里面入口）打印甲(彩绘甲)
const getPrintOrderList = (params) => {
	return request({
	    url: "/nailPrintOrder/queryMyOrderList",
	    method: "GET",
	    params: removeStr(params),
	})
}

// 我的订单详细取消（我的里面入口）
const getCancelGoodsOrder= (params) => {
	return request({
	    url: "/nailGoodsOrder/cancelGoodsOrder",
	    method: "GET",
	    params: removeStr(params),
	})
}

// 通过id查询订单详情(彩绘甲)
const getPrintOrderInfo = (params) => {
	return request({
	    url: "/nailPrintOrder/queryById",
	    method: "GET",
	    params: removeStr(params),
	})
}

// 扫码打印
const getCodePrintOrder = (params) => {
	return request({
	    url: "/nailPrintOrder/printOrder",
	    method: "GET",
	    params: removeStr(params),
	})
}

// 关闭订单
const closePrintOrder = (params) => {
	return request({
	    url: "/nailPrintOrder/closeOrder",
	    method: "GET",
	    params: removeStr(params),
	})
}

// 查询我的商品订单列表
const queryMyGoodsOrderList = (params) => {
	return request({
	    url: "/nailGoodsOrder/queryMyGoodsOrderList",
	    method: "GET",
	    params: removeStr(params),
	})
}

// 查询我的商品订单详情
const queryGoodsOrderInfo = (params) => {
	return request({
	    url: "/nailGoodsOrder/queryGoodsOrderInfo",
	    method: "GET",
	    params: removeStr(params),
	})
}

export {
	getGoodsOrderList,
	getGoodsOrderInfo,
	getPrintCancelOrder,
	getSharePrintOrder,
	getPrintOrder,
	getPrintOrderList,
	getCancelGoodsOrder,
	getPrintOrderInfo,
	getCodePrintOrder,
	closePrintOrder,
	queryMyGoodsOrderList,
	queryGoodsOrderInfo
}